﻿using WinRTFramework.Common;
using WinRTFramework.Interfaces.Contracts.Settings.View;
using Windows.UI.ApplicationSettings;
using Windows.UI.Xaml.Media.Animation;

// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

namespace ApplicationSettings.Settings
{
    public sealed partial class PermanentSettings : LayoutAwarePage, ICareAboutSettingsEdgeLocation
    {
        // The guidelines recommend using 100px offset for the content animation.
        const int ContentAnimationOffset = 100;

        public PermanentSettings()
        {
            this.InitializeComponent();
        }

        #region ICareAboutSettingsEdgeLocation
        public SettingsEdgeLocation SettingsEdgeLocation { set
        {
            FlyoutContent.Transitions = new TransitionCollection();
            FlyoutContent.Transitions.Add(new EntranceThemeTransition()
            {
                FromHorizontalOffset = (value == SettingsEdgeLocation.Right) ? ContentAnimationOffset : (ContentAnimationOffset * -1)
            });       
        } }
        #endregion

    }
}
